<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arr = ['zhang', 'fgh', 'wang', 'li', 'kkk','ooo', 'lll']
    // 1.得到一个随机数,作为数组的索引号 随机数0-6
    let random = Math.floor(Math.random() * arr.length)
    document.write(arr[random])

    // 3.删除该名字
    arr.splice(random, 1)
    console.log(arr)
  </script>
</body>
</html>